package com.mbigger.admin.controller;

import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.servlet.ModelAndView;

@Controller
@RequestMapping("/console")
public class ConsoleController {

	private static final String MODULE = "管理后台";

	private void setPageAttr(Model model, String page, String description) {
		model.addAttribute("page", page);
		model.addAttribute("description", description);
		model.addAttribute("module", MODULE);
	}

	@RequestMapping("")
	public ModelAndView index(Model model) {
		setPageAttr(model, "控制台", "系统运行状态监测及应用快捷入口");
		return new ModelAndView("console/index");
	}
	public void verify() {
		
	}
	
	@RequestMapping("/login")
	public ModelAndView login(Model model) {
		setPageAttr(model, "管理员登录", "请输入管理员账号与密码，登录管理后台");
		return new ModelAndView("console/login");
	}

	@RequestMapping("/user")
	public ModelAndView user(Model model) {
		setPageAttr(model, "用户管理", "用户及部门管理");
		return new ModelAndView("console/user");
	}

	@RequestMapping("/role")
	public ModelAndView role(Model model) {
		setPageAttr(model, "角色管理", "定义系统角色，配置用户角色，赋予角色权限");
		return new ModelAndView("console/role");
	}

	@RequestMapping("/security")
	public ModelAndView security(Model model) {
		setPageAttr(model, "安全管理", "操作日志查看，系统密码策略管理");
		return new ModelAndView("console/security");
	}

	@RequestMapping("/data")
	public ModelAndView data(Model model) {
		setPageAttr(model, "数据管理", "电站/变电站 - 设备 - 数据点，三层建模，轻松导入导入");
		return new ModelAndView("console/data");
	}

	@RequestMapping("/comm")
	public ModelAndView comm(Model model) {
		setPageAttr(model, "通讯管理", "查看通讯状态，启动/停止通讯，通讯参数管理");
		return new ModelAndView("console/comm");
	}

	@RequestMapping("/notify")
	public ModelAndView notify(Model model) {
		setPageAttr(model, "通知设置", "设置各类型通知的通知方式，个性化推送企业关心信息");
		return new ModelAndView("console/notify");
	}

	@RequestMapping("/system")
	public ModelAndView system(Model model) {
		setPageAttr(model, "系统设置", "设置系统参数");
		return new ModelAndView("console/system");
	}

}
